package com.awangyh.jdk8.file;

import java.io.BufferedReader;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;

/**
 * Created by admin on 2017/4/10.
 */
public class JsonFileReadDemo {

    public static void main(String[] args) {
        String fileName = "D:\\ZD_IDE\\apache-tomcat-8.5.13\\bin\\private\\netValues\\netValue\\SD9270.json";
        StringBuilder json = new StringBuilder("");

        try (BufferedReader br = Files.newBufferedReader(Paths.get(fileName))) {
            //br returns as stream and convert it into a List
            br.lines().forEach(s -> json.append(s));
        } catch (IOException e) {
            e.printStackTrace();
        }

        System.out.println(json.toString());
    }
}
